<template>
  <div class="view-friends">
    <LightText
      :show-num="1"
      red-text="Friendly Links"
      font-size="6em"
      class="lightText"
    ></LightText>
    <div class="box">
      <!-- 链接组 -->
      <div class="ljz">
        <ul>
          <li v-for="friend in friends" :key="friend.id">
            <div class="avatar">
              <div class="mask"></div>
              <img :src="friend.src" />
            </div>
            <div class="info">
              <a :href="friend.href" target="_blank">{{ friend.name }}</a>
              <span>{{ friend.brief }}</span>
            </div>
          </li>
        </ul>
      </div>
     
    </div>
  </div>
</template>

<script>
import ViewCover from "../../components/ViewCover.vue";
import LightText from "@/components/lightText.vue";
export default {
  name: "HomeViewFriends",
  components: {
    ViewCover,
    LightText,
  },
  data() {
    return {
      friends: [
        {
          id: "1",
          src: "/friends/csdn.png",
          brief: "CSDN是全球知名中文IT技术交流平台",
          href: "https://www.csdn.net/",
          name: "CSDN社区",
        },
        {
          id: "2",
          src: "/friends/zhihu.png",
          brief: "中文互联网问答社区和创作者聚集的原创内容平台",
          href: "https://www.zhihu.com/",
          name: "知乎",
        },
        {
          id: "3",
          src: "/friends/github.png",
          brief: "GitHub是一个面向开源及私有软件项目的托管平台",
          href: "https://github.com/",
          name: "github",
        },
        {
          id: "4",
          src: "/friends/gitee.png",
          brief: "Gitee是开源中国推出的基于Git的代码托管服务",
          href: "https://gitee.com/enterprises?utm_source=baidu&utm_medium=sem&utm_term=gitee%20%CB%BD%D3%D0%BB%AF%B2%BF%CA%F0%20%B6%E0%C9%D9%C7%AE&utm_campaign=enterprise&utm_content=competition&wl_kwid=277190337714&wl_creativeid=50293005302&wl_groupid=5892569673&wl_planid=154358752&wl_kw=gitee+%E7%A7%81%E6%9C%89%E5%8C%96%E9%83%A8%E7%BD%B2+%E5%A4%9A%E5%B0%91%E9%92%B1&wl_userid=25441451&wl_crowdid=0&wl_src=baidu&bd_vid=12825441190717424072",
          name: "Gitee",
        },
      ],
      add: {
        src: "",
        brief: "",
        href: "",
        name: "",
      },
    };
  },
  methods: {
    submit() {
      this.$message({
        type: "success",
        message: "提交成功! 审核通过后就会显示喔~",
        showClose: true,
        duration: 1500,
      });
    },
  },
};
</script>

<style lang="stylus" scoped>
.view-friends {
  padding-top: 200px;
  background-color: #f5f7fa;
}

.box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;

  .ljz {
    cursor:pointer
    ul {
      max-width: 1270px;
      min-width: 800px;
      padding: 15px;
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: space-between;
      background: var(--div);
      border-radius: 10px;
      box-shadow: 0 1px 30px -4px var(--shadow);
      transition: all 0.5s;
      box-sizing: border-box;
      transition: all 0.5s;

      li {
        display: flex;
        align-items: center;
        width: calc(33% - 10px);
        min-width: 280px;
        border-radius: 10px;
        margin: 5px;
        background: var(--mask);
        padding: 10px 0 10px 15px;

        .avatar {
          position: relative;
          width: 50px;
          height: 50px;
          text-align: center;
          padding-top: 6px;
          border-radius: 5px;
          overflow: hidden;

          img {
            width: 85%;
          }

          // 遮罩
          .mask {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 2;
            background: var(--mask);
            border-radius: 5px;
            transition: all 0.6s;
            // & + img
            // transition: all .6s
            // &:hover + img
            // transform: scale(1.1);
          }
        }

        .info {
          a {
            transition: all 0.5s;

            &:hover {
              color: #41b883;
            }
          }
        }

        .info {
          padding: 15px 15px;

          a {
            font-size: 15px;
            font-weight: bold;
            color: var(--color);
            text-decoration: none;
          }

          span {
            display: block;
            margin-top: 5px;
            font-size: 13px;
            color: var(--color);
            opacity: 0.7;
          }
        }
      }
    }
  }

  .title {
    position: relative;
    width: 1270px;
    margin: 15px 0;
    padding: 5px 30px;
    font-size: 15px;
    font-weight: bold;
    text-align-last: left;

    &::before {
      position: absolute;
      content: '';
      width: 4px;
      background: #45b985;
      top: 10%;
      left: 10px;
      bottom: 10%;
      border-radius: 5px;
    }
  }

  // 提交链接 卡片
  .card {
    width: 1270px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    background: var(--div);
    border-radius: 10px;
    box-shadow: 0 1px 30px -4px var(--shadow);
    transition: all 0.5s;
    box-sizing: border-box;
    transition: all 0.5s;

    .submit-btn {
      background-color: #cef8ee !important;
    }

    ul {
      display: flex;
      flex-direction: column;
      padding: 15px 0;
      align-items: center;
      // justify-content center
      width: 100%;

      li {
        display: flex;
        align-items: center;
        width: 80%;
        margin-top: 15px;
        box-sizing: border-box;

        span {
          width: 100px;
          margin-right: 20px;
          font-size: 15px;
          font-weight: bold;
          text-align: right;
        }

        input {
          flex: 1;
          background: var(--mask);
          height: 30px;
          border: 1px solid transparent;
          outline: none;
          padding: 0 15px;
          border-radius: 10px;
          box-sizing: border-box;
          font-size: 16px;
          color: #4bbc89;
          transition: all 0.5s;

          &:hover {
            border: 1px solid rgba(65, 184, 131, 0.9);
          }
        }
      }
    }
  }
}
</style>
